import { apiRequest } from '../request';

// 用户登录
export function fetchUserLogin(data: {
  uid: string;
  pwd: string;
  vcode?: string;
}) {
  return apiRequest<any>({
    url: '/user/login',
    method: 'post',
    data
  });
}

// 获取用户信息
export function fetchUserInfo(data: object) {
  return apiRequest<any>({
    url: '/user/info',
    method: 'post',
    data
  });
}

// 修改密码
export function fetchChangePassword(data: {
  newPwd: string;
  oldPwd: string;
  userCode: string;
}) {
  return apiRequest<any>({
    url: '/user/modifyUserPwd',
    method: 'post',
    data
  });
}

// 获取菜单
export function fetchGetAppNav(params: object) {
  return apiRequest<any>({
    url: '/init/getAppNav',
    method: 'get',
    params
  });
}